home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Belgian Amiga Club - ADF Collection
/
BS1 part 47.7z
/
BS1 part 47
/
ImageMaster RT v1.50b (1994)(Black Belt Systems)(Disk 4 of 7)[HD].7z
/
ImageMaster RT v1.50b (1994)(Black Belt Systems)(Disk 4 of 7)[HD].adf
/
apa.lzh.parta
/
imh_ubuffers
< prev
next >
Wrap
Text File
|
1994-04-22
|
9KB
|
190 lines
\ApAssist
\: "imdoc:imh_ubuffers" Understanding Buffers - portion of the IM documentation
\font topaz.font 8
\tc 1
\wr
\lj
\index "imdoc:imh_index/index"
\toc "imdoc:imh_toc/toc"
\help "imdoc:aa_help/help"
\node "ubuffers"
\title "Understanding Image Buffers"
\prev "IMDOC:imh_intro/aboutdocs"
\next "IMDOC:imh_bigthree/bigthree"
\nw \{ \font topaz.font 11 \tc 15 \ts b
General
\}
\wr
Imagemaster R/t is designed to handle any number of images loaded into memory
at one time. This is the source of considerable flexibility, and so you need
to understand exactly how Imagemaster R/t manages these images.
The first thing to understand is that an image buffer is \ts i always \ts n
24-bits per image pixel. It doesn't matter if the image was only two colors,
or if it had millions; when Imagemaster R/t loads an image, it creates only
one type of image buffer and that is the 24-bit type we're talking about
right now. Greyscale, color - none of this makes any difference; Imagemaster
R/t still creates 24-bits per pixel.
Next, image buffers are \ts i always \ts n rectangular. Imagemaster R/t is
able to maintain a mask for an image, allowing the usuable area to be
non-rectangular, however the memory has been obtained from the Amiga
operating system to hold information for the entire rectangle.
The final basic idea is that \ts i all \ts n images within Imagemaster R/t
are maintained in the exact same type of buffer. That means if you load a
brush to paint with, an image buffer is allocated for it and the the brush is
loaded into the buffer. If you want to use a classic "alpha channel"
technique, the alpha channel will come from - you guessed it - a standard
image buffer.
The advantages of this system are manyfold. First, because all images are
loaded into exactly the same kind of buffer, you gain the ability to do
\ts u anything\ts n \= to any image. You can run image processes on a "brush",
and you can paint in an "alpha channel". You can swap the roles of the images
that are loaded in a flash - turn the alpha channel into a paintbrush and the
paintbrush into the main image to work on where you can paint on \ts i
it\ts n .
To make all this work smoothly, we need a way to identify which buffer is
which easily, and so Imagemaster R/t allows you to name image buffers. Each
loaded or newly created buffer gets a name; if Imagemaster has a hint of what
you would like it to be called, it will use it; otherwise, it names the
buffer \ts b Clip_n \ts n or \ts b Brush_n \ts n where "n" is a number from 1
to some very high value. If it decides to name something a "clip" or a
"brush", it will normally also give you the opportunity to rename it at the
time it creates the buffer. This automatic numbering and naming system makes
it unlikely that you'll have two image buffers with the same name (although
this is certainly possible; it's just confusing).
Imagemaster R/t \ts i also \ts n allows you to select buffers by clicking on
\ts bi postage stamp \ts n images which show you exactly what is in a
particular buffer. This is a very "friendly" way to choose what you're going
to work on at any given moment.
Image buffers keep more than just the picture information and the optional
mask of the image's shape. They also hold on to some important statistics
about the image, such as...
\nw \{ \lm 40
\{ \ra \image "Clips/Bullet2.pic" l 10 The image's \ts i Aspect Ratio \ts n \}
\{ \ra \image "Clips/Bullet2.pic" l 10 The image's \ts i DPI \ts n or Dots Per Inch\}
\{ \ra \image "Clips/Bullet2.pic" l 10 The image's last used zoom level (for editing)\}
\{ \ra \image "Clips/Bullet2.pic" l 10 The image's name\}
\{ \ra \image "Clips/Bullet2.pic" l 10 The image's unique internal identifier\}
\{ \ra \image "Clips/Bullet2.pic" l 10 The image's \ts i parent \ts n if it was a "clip" or a "brush"\}
\{ \ra \image "Clips/Bullet2.pic" l 10 Locking information; if the image is in use, it is "locked"\}
\}
\wr
Most of this information is normally hidden from you; for instance, the only
time you need to know about the image's aspect ratio is when you create a
completely new image or if an image is loaded which has an incorrect aspect
ratio (this happens often on the Amiga, however). So you'll only see the
image aspect ratio if you change it. Imagemaster R/t uses the image aspect
information at all times in order to show you the image in it's correct
shape. Without aspect information, images might look stretched, or squashed.
\nw \{ \font topaz.font 11 \tc 15 \ts b
Image buffer \ts i Roles
\}
\wr
While Imagemaster R/t only has one type of image buffer, image buffers may
have several different \ts i roles\ts n . A role in this context is what part
in your image manipulation efforts a particular image buffer is "playing".
These are all of the possible roles:
\nw \{ \lm 40
\{ \ra \image "Clips/Bullet2.pic" l 10 Primary Buffer\}
\{ \ra \image "Clips/Bullet2.pic" l 10 Secondary Buffer\}
\{ \ra \image "Clips/Bullet2.pic" l 10 Blend Buffer\}
\{ \ra \image "Clips/Bullet2.pic" l 10 Brush Buffer\}
\{ \ra \image "Clips/Bullet2.pic" l 10 No role assigned\}
\}
\wr
When an image is being directly worked on - that is, you are processing it,
painting on it or composing other images \ts i into \ts n it, that image is
in the role of the \ts b Primary Buffer\ts n . The reasoning is simple:
Operations primarily affect this image buffer, and not others.
When an image is being used in the paint system as a brush, it is in the role
of the \ts b Brush Buffer\ts n .
When an image is used as a source image being composed \ts i into \ts n
another buffer, it is in the role of the \ts b Secondary Buffer\ts n .
When an image is used as an \ts i alpha channel mask \ts n for either an
image composition, brush transparency, or Unsharp Masking, it is in the role
of the \ts b Blend Buffer\ts n .
\nw \{ \font topaz.font 11 \tc 15 \ts b
The Undo Buffer
\}
\wr
There is one other type of buffer, and that is the buffer that is assigned to
the role of the \ts i Undo \ts n buffer. The Undo buffer is where Imagemaster
R/t copies the image just \ts i before \ts n it makes any changes you have
specified. The reason this is done is so that if you decide you don't
\ts u like\ts n \= the change you made, you can request an Undo operation
which is simply when Imagemaster R/t copies the contents of the Undo buffer
back into your main image. Actually, it's a little bit more interesting than
that; if there is already something in the Undo buffer, Imagemaster R/t will
swap those contents with your buffer, which allows you to "Undo an Undo". The
role of the Undo buffer is so specialized that Imagemaster R/t is able to
manage it with no assistance from you; for this reason, although you will see
the Undo buffer listed with all the other buffers in the system, you are not
allowed to select it for processing.
\nw \{ \font topaz.font 11 \tc 15 \ts b
Image buffers consume large amounts of memory
\}
\wr
\lab "more" The final thing you should know about image buffers is how much
memory an image is likely to consume. You don't need to know exactly, but you
should have a general idea because since Imagemaster R/t can load \ts i any
\ts n number of images, it can use up \ts b all \ts n of your free memory
without much warning. Here are the calculations for memory consumption:
\nw \{ \lm 40
\ts b In all cases: \ts n
(X size) x (Y size) x 3 - Any non-primary unmasked buffer
(X size) x (Y size) x 4 - Any non-primary masked buffer
\ts b If the UnDo buffer function is \ts i off\ts n : \ts n
(X size) x (Y size) x 4 - Any primary unmasked buffer
(X size) x (Y size) x 5 - Any primary masked buffer
\ts b If the UnDo buffer function is \ts i on\ts n : \ts n
(X size) x (Y size) x 7 - Any primary unmasked buffer
(X size) x (Y size) x 8 - Any primary masked buffer
\}
\wr
As you should be able to see, large images will use large amounts of your
computer's memory. Let's do a quick example. If you load an image which is
sized at 768x480 and has no mask, which makes it the primary buffer,
and the Undo function is on, then we use this formula:
(X size) x (Y size) x 7 - Any primary unmasked buffer
So the calculation is: 768 x 480 x 7 = 2,580,480 bytes. Over two and a half
megabytes of memory. Larger images consume more memory; smaller ones consume
less. A mathematical law called the "Square Law" is at work here. If another
image is one half as high and one half as wide, it will consume one
\ts i quarter \ts n the amount of memory. As an example, 368 x 240 x 7 = 618,240
bytes of memory.
One thing you can be certain of, is that the more memory you have in your
Amiga, the more you'll be able to do at once.
\endnode